package com.ohs.dal.dao.impl;

import java.util.List;

import com.ohs.dal.dao.RoleDAO;
import com.ohs.dal.model.Role;

public class RoleDAOImpl extends AbstractDAOImpl<Role> implements RoleDAO {

	public void add(Role entity) {

	}

	public List list() {
		return getHibernateTemplate().find("from " + Role.class.getName());
	}

	public Role get(long roomId) {
		return (Role) getHibernateTemplate().get(Role.class, roomId);
	}

	public Role getByName(String name) {
		return (Role) getHibernateTemplate().find("from " + Role.class.getName() + " r where r.name='" + name + "'").get(0);
	}
}
